package com.sniff.atp.provider;

/**
 * @BelongsProject: sniff-atp
 * @BelongsPackage: com.sniff.atp.provider
 * @Author: zxy
 * @CreateTime: 2024-01-26 16:25
 * @Description: TODO
 * @Version: 1.0
 */
public class DynamicDataSourceContextHolder {

    public static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();

    public static void setDataSourceType(String dsType) {
        CONTEXT_HOLDER.set(dsType);
    }

    public static void clearDataSourceType() {
        CONTEXT_HOLDER.remove();
    }

    public static String getDataSourceType() {
        return CONTEXT_HOLDER.get();
    }

}
